import loadable from '../utils/loadable'
import Auth from '../components/Auth'
const Login=loadable(()=>import('../views/Login'))
const Home=loadable(()=>import('../views/Home'))
const UserList=loadable(()=>import('../views/home/UserList'))
const NotFound=loadable(()=>import('../views/NotFound'))
const Workplace=loadable(()=>import('../views/home/Workplace'))
const Analysis=loadable(()=>import('../views/home/Analysis'))
const StudentList=loadable(()=>import('../views/home/StudentList'))
const UserDetail=loadable(()=>import('../views/home/UserDetail'))
const routes=[
    {
        path:'/login',
        element:<Login/>
    },
    {
        path:'/home',
        element:<Auth><Home/></Auth>,
        children:[
            {
                path:'userList',
                element:<UserList></UserList>
            },
            {
                path:'workplace',
                element:<Workplace></Workplace>
            },
            {
                path:'analysis',
                element:<Analysis></Analysis>
            },
            {
                path:'studentList',
                element:<StudentList></StudentList>
            },
            {
                path:'userDetail/:id',
                element:<UserDetail></UserDetail>
            },
            {
                path:'*',
                element:<NotFound></NotFound>
            }
        ]
    },
    {
        path:'*',
        element:<NotFound></NotFound>
    }
    
]
export default routes